Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert validatorActiveLongEnough check to be more clear #8196

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

jtraglia
Copy link
Contributor

PR Description

There was a hint of confusion when reading this check. The variable name (validatorActiveLongEnough) doesn't quite match what it represents. I was reading it as: "if the validator is active long enough, reject this" which is wrong.

// Check if validator has been active long enough
final boolean validatorActiveLongEnough =
currentEpoch.isLessThan(
validator.getActivationEpoch().plus(specConfig.getShardCommitteePeriod()));
if (validatorActiveLongEnough) {
return;
}

Also add a few final specifiers which I know we like.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Copy link
Contributor

@courtneyeh courtneyeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zilm13 zilm13 enabled auto-merge (squash) April 15, 2024 18:58
@zilm13 zilm13 merged commit b549a70 into Consensys:master Apr 15, 2024
16 checks passed
@jtraglia jtraglia deleted the final-and-active branch April 15, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants